import { regisUserApi } from '../http/httpUser'
export default {
    namespaced: true,
    state: {
        imageUrl: '',
        card: [],
        cardd: [],
        carddd: [],
        user: {},
        tablecus: []
    },
    getters: {},
    mutations: {
        creatcus(state, data) {
            state.tablecus = data
        },
        creatCard(state, data) {
            if (data.title == 'baoyou') { state.card.push(data) }
            if (data.title == 'zhekou') { state.cardd.push(data) }
            if (data.title == 'jifen') { state.carddd.push(data) }
        }

    },
    actions: {
        setTestAc(context) {
            return new Promise((resolve, reject) => {
                regisUserApi()
                    .then((res) => {
                        console.log(2)
                            // if (res.data.code==200) {
                        context.commit('setTest', res.data)
                            // console.log(res.data)
                            // 请求全体客户然后存入vuex
                            // } 
                        resolve();
                    })
                    .catch((err) => {
                        reject(err);
                    })
            })

        }
    },
}